package com.limit.aspect;

import com.limit.annotation.TokenBucketLimit;
import com.limit.aspect.core.AnnotationAspectTemplate;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

import java.lang.annotation.Annotation;

/**
 * @title: RateLimitAspect
 * @Author xu-xiang
 * @Date: 2024/3/23 11:49
 * @description: 限流aop-令牌桶限流
 */
@Aspect
public class TokenBucketRateLimitAspect extends AnnotationAspectTemplate {

    @Override
    @Pointcut("@annotation(com.limit.annotation.TokenBucketLimit) || @within(com.limit.annotation.TokenBucketLimit)")
    public void pointcut() {
    }

    @Override
    public Class<? extends Annotation> pointcutAnnotationClass() {
        return TokenBucketLimit.class;
    }
}
